/*

Author   : chaos

FileName : self_def.cpp

Date     : 16/08/17 10:26:33

*/
#include <iostream>
using namespace std;

class Reader
{
    private:
        char name[5];
        int id;

    public:
        friend ostream & operator<< (ostream & s, Reader & r);
        friend istream & operator>> (istream & s, Reader & r);
};

ostream & operator << (ostream &s,Reader & r)
{
    cout << r.id << " " << r.name;
    return s;

}

istream & operator >> (istream & s, Reader & r)
{
    cin >> r.id >> r.name;
    return s;
}
int main(int argc ,char *argv[])
{
    Reader a_Reader;

    cout << "Please input a reader's data :" << endl;
    cin >> a_Reader;
    cout << "Reader's data: " << a_Reader << endl;


    return 0;
}
